import 'package:flutter/material.dart';
import 'package:flutter_module/widget/tap_appbar.dart';
import 'package:flutter_screenutil/screenutil.dart';

class CarPage extends StatefulWidget {
  @override
  _CarPageState createState() => _CarPageState();
}

class _CarPageState extends State<CarPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: TapAppBar(
          TapViewBar(
            Text("车辆设备管理"),

          ),
          Size.fromHeight(ScreenUtil().setHeight(80))
      ),
      body: SingleChildScrollView(
          child: Column(
            children: <Widget>[
              InkWell(
                  onTap: () {},
                  child: getItem("images/cheliang/cl1.png", "档案管理")
              ),
              InkWell(
                  onTap: () {},
                  child: getItem("images/cheliang/cl2.png", "维修管理")
              ),
              InkWell(
                  onTap: () {},
                  child: getItem("images/cheliang/cl3.png", "车辆租赁")
              ),
              InkWell(
                  onTap: () {},
                  child: getItem("images/cheliang/cl4.png", "保险记录")
              ),
              InkWell(
                  onTap: () {},
                  child: getItem("images/cheliang/cl5.png", "年检记录")
              ),
              InkWell(
                  onTap: () {},
                  child: getItem("images/cheliang/cl6.png", "综合查询")
              ),
              InkWell(
                  onTap: () {},
                  child: getItem("images/cheliang/cl7.png", "维修费用记录")
              ),
              InkWell(
                  onTap: () {},
                  child: getItem("images/cheliang/cl8.png", "综合查询（含费用）")
              ),
              //      getItem(icon, title),getItem(icon, title),getItem(icon, title),getItem(icon, title),


            ],
          ),
      ),

    );
  }

  Widget getItem(String icon, String title) {
    return Container(
      alignment: Alignment.centerLeft,
      height: ScreenUtil().setHeight(100),
      margin: EdgeInsets.only(left: 20),
      decoration: BoxDecoration(
          border: Border(bottom: BorderSide(
              width: 1, color: Colors.black12
          ))
      ),
      child: ListTile(
        leading: Image.asset(icon, width: ScreenUtil().setWidth(60),height: ScreenUtil().setHeight(60),),
        title: Text(title),
        trailing: IconButton(
            icon: Icon(Icons.keyboard_arrow_right), onPressed: null),
      ),
    );
  }
}
